#include<stdio.h>
int main()
{
  int A,B,Sum,i,t;
  scanf("%d %d",&A,&B);
  Sum=t=0;
  for(i=A;i<=B;i++)
  {
    Sum+=i;
    printf("%5d",i);
    t++;
    if(t%5==0&&i!=B)
    {
      printf("\n");
      t=0;
    }
  }
  printf("\n");
  printf("Sum = %d",Sum);
  return 0;
}
